<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="./source/modules/icard/template/css/card.css" media="all">
    <script type="text/javascript" src="./source/modules/icard/template/js/jQuery.js"></script>
    <script type="text/javascript" src="./source/modules/icard/template/js/accordian_pack.js"></script>
    <title>会员特权</title>
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <meta name="format-detection" content="telephone=no">
</head>

<body id="cardpower" ondragstart="return false;" onselectstart="return false;">
    <section class="body">

    <div id="basic-accordian">
        {php $index = 0;}
        {loop $privileges $privilege}
        <div id="test{$index}-header" class="accordion_headings {if $index==0}header_highlight{/if}">
			<div class="tab vip">
                <span class="title">{$privilege['title']}<p>{php echo date('Y-m-d', $privilege['endtime']);}</p></span>
			</div>
			<div id="test{$index}-content" style="display: block; overflow: hidden; opacity: 1;">
			    <div class="accordion_child">
			    	<p class="explain_sn" style="width: 70%;margin: 0px auto;color: #fff;">
                        {if TIMESTAMP > $privilege['endtime']}
                            <div style="height: 25px;line-height: 25px;font-size:14px;" class="disabled">已结束</div>
                        {else}
                            {if $privilege['count'] == 0}
                                <a style="height: 25px;line-height: 25px;font-size:14px;" class="submit" href="{php echo create_url('mobile/module', array('do' => 'wapmakesncode', 'from_user' => $page_from_user, 'name' => 'icard', 'weid' => $weid, 'type' => $type, 'id' => $privilege['id']))}">立即使用</a>
                                <p class="explain_sn">
                                <span style="font-size:12px;line-height:16px;text-align:left;padding:5px 0 5px 16px;">请点击上面的按钮使用或由商家扫描二维码</span>
                                {php echo $this->getQRImage('privilege_'.$privilege['id'],create_url('mobile/module', array('do' => 'wapmakesncodeadmin', 'from_user' => $page_from_user, 'name' => 'icard', 'weid' => $weid, 'type' => $type, 'id' => $privilege['id'])));}
                                </p>
                            {elseif $giftcount_arr[$privilege['id']] >= $privilege['count']}
                                <div style="height: 25px;line-height: 25px;font-size:14px;" class="disabled">已使用</div>
                            {else}
                                <a style="height: 25px;line-height: 25px;font-size:14px;" class="submit" href="{php echo create_url('mobile/module', array('do' => 'wapmakesncode', 'from_user' => $page_from_user, 'name' => 'icard', 'weid' => $weid, 'type' => $type, 'id' => $privilege['id']))}">立即使用</a>
                                <p class="explain_sn">
                                <span style="font-size:12px;line-height:16px;text-align:left;padding:5px 0 5px 16px;">请点击上面的按钮使用或由商家扫描二维码</span>
                                {php echo $this->getQRImage('privilege_'.$privilege['id'],create_url('mobile/module', array('do' => 'wapmakesncodeadmin', 'from_user' => $page_from_user, 'name' => 'icard', 'weid' => $weid, 'type' => $type, 'id' => $privilege['id'])));}
                                </p>
                            {/if}
                        {/if}
			        </p>
			    	<b>详情说明</b>
			    	<ul>{php echo htmlspecialchars_decode($privilege['content']);}</ul>
			    </div>
		    </div>
		</div>
        {php $index++;}
        {/loop}
	</div>
	<div class="plugback">
		<a href="javascript:history.back(-1)">
			<div class="plugbg themeStyle">
				<span class="plugback"></span>
			</div>
		</a>
    </div>
    {php include $this->template('footer');}
<script>
window.onload = function(){
	new Accordian('basic-accordian',6,'header_highlight');
}
</script>
<script>
	var jQ = jQuery.noConflict();
	function power(i,sncode,pid){
		var parssword =  document.getElementById('parssword'+i).value;
		var money =  document.getElementById('money'+i).value;
		var submitData = {
			parssword:parssword,
			sncode: sncode,
			money: money,
			pid: pid,
			action: "power"
		};
		jQ.post('index.php?ac=cardpower1&tid=574&c=o5JGbjuFTr6lumWIyyW3yfP-G5m0', submitData,
			function(data) {
				if (data.password == true) {
					document.getElementById('queren'+i).style.display='none';
				 	document.getElementById('sn'+i).innerHTML=data.msg;
				  	document.getElementById('parssword'+i).value = '';
					document.getElementById('money'+i).value='';
					alert(data.msg);
				}else{
				jQ('#parssword'+i).addClass('err');
				// document.getElementById('parssword'+i).value=data.msg;
				}
			}, "json");
	}
</script>
</section>

</body></html>